import request from './request'

// 获取系统配置
export const getSystemConfig = (params) => {
  return request({
    url: '/systemConfigs/key',
    method: 'get',
    params
  })
}


// 获取配置列表
export const getConfigList = (params) => {
  return request({
    url: '/systemConfigs',
    method: 'get',
    params
  })
}

// 获取单个配置信息
export const getConfigInfo = (id) => {
  return request({
    url: `/systemConfigs/${id}`,
    method: 'get'
  })
}

// 创建配置
export const createConfig = (data) => {
  return request({
    url: '/systemConfigs',
    method: 'post',
    data
  })
}

// 更新配置
export const updateConfig = (id, data) => {
  return request({
    url: `/systemConfigs/${id}`,
    method: 'put',
    data
  })
}

// 删除配置
export const deleteConfig = (id) => {
  return request({
    url: `/systemConfigs/${id}`,
    method: 'delete'
  })
}